/**
 * openfire_src
 */
package com.kingray.openfire.plugin.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.jivesoftware.openfire.XMPPServer;
import org.jivesoftware.openfire.vcard.VCardEventDispatcher;
import org.jivesoftware.openfire.vcard.VCardManager;

import com.kingray.openfire.plugin.handler.KingrayVCardHandler;

/**
 * 用于同步用户的头像以及电话号码等
 * @author XiongYingqi
 * @version 2013-7-4 上午10:39:30
 */
public class VCardServiceServlet extends HttpServlet{

	private VCardManager vCardManager;
	/**
	 * <br>2013-7-4 上午10:40:19
	 * @see javax.servlet.GenericServlet#init()
	 */
	@Override
	public void init() throws ServletException {
		vCardManager = XMPPServer.getInstance().getVCardManager();
		
		KingrayVCardHandler cardHandler = new KingrayVCardHandler();
		VCardEventDispatcher.addListener(cardHandler); // 添加VCard监听
	}
	
	/**
	 * <br>2013-7-4 上午10:40:30
	 * @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
	 */
	@Override
	protected void doGet(HttpServletRequest request,
			HttpServletResponse response)
			throws ServletException, IOException {
		doPost(request, response);
	}
	
	/**
	 * <br>2013-7-4 上午10:40:34
	 * @see javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
	 */
	@Override
	protected void doPost(HttpServletRequest request,
			HttpServletResponse response)
			throws ServletException, IOException {
		super.doPost(request, response);
	}
	
	protected void updateVCard(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
	}
	
}
